package com.john.study.ejb;

import javax.ejb.DependsOn;
import javax.ejb.Stateless;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by John Jiang on 4/9/2015.
 */
@DependsOn("helloejb-api-1.0.0.jar")
@Stateless
public class HelloBean implements HelloRemote {
    public static final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    @Override
    public void hello(String name) {
        System.out.println("Hello " + name + " !");
    }

    @Override
    public String getServerTime() {
        return simpleDateFormat.format(new Date());
    }
}
